home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 90 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  3.4 KB

  1. Path: fido.asd.sgi.com!austern
  2. From: chase@centerline.com (David Chase)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Throwing an exception from within a si
  5. Date: 22 Jan 1996 10:15:23 PST
  6. Organization: CenterLine Software
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <4e0b47$1k9@wcap.centerline.com>
  9. References: <4dos4l$ra9@engnews1.Eng.Sun.COM>
  10. Reply-To: chase@centerline.com
  11. NNTP-Posting-Host: isolde.mti.sgi.com
  12. X-Original-Date: 22 Jan 1996 15:39:51 GMT
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBVAwUBMQPUhUy4NqrwXLNJAQG9mAIAyxfJHicbVQg9H6NdG6U55eurZtAkBL4v
  15.     46LMI9eYlVz90Ud5yeSSm89zBl3xLr7ROIPjkPijpKOgdvaPeahFFQ==
  16.     =Y6LS
  17. Originator: austern@isolde.mti.sgi.com
  18.  
  19. Ugh.  My earlier reply may have been less temperate than I like.
  20. The point I wish to make is that there is no calling-convention-
  21. technical reason making it impossible to implement asynchronous
  22. exception handling on most machines.  The costs vary, but are
  23. usually low, or can be engineered to be low (if you insist on
  24. shrink-wrapping the register saves for every single procedure
  25. that you compile, the costs will be unreasonable, but the obvious
  26. engineering choice is to only shrink-wrap where it is profitable,
  27. and pay the table size cost there).
  28.  
  29. Furthermore, there are reasons to like asynchronous exceptions.
  30. Sometimes, things are asynchronous.  Timers expire.  People chop
  31. network connections with backhoes.  Printers catch fire.  One
  32. person that I worked alongside, if not with, in two different
  33. jobs, chewed my ear off (even though I agreed with him) on the
  34. necessity for asynchronous exception-handling.
  35.  
  36. However, there are some language problems with asynchronous
  37. exception-handling.  At the machine level, async exceptions can be
  38. dealt with in an abort/commit/finish-quickly style that always gets you
  39. to a defined state.  To properly deal with asynchronous exceptions, the
  40. abort/commit/finish style has to percolate upward from the machine
  41. level, through every assignment statement, and through every
  42. interface.  With very careful design of the constructor and destructor
  43. interaction, together with careful specification of both concurrent
  44. semantics and pseudo-atomic semantics (pseudo-atomic means atomic with
  45. respect to ones' own interrupt routines, but not atomic with respect to
  46. another thread), this can happen.  Essentially, every operation either
  47. finishes (commits) with its defined semantics, or else it throws an
  48. exception (aborts) and backs out the operation (transaction) to a
  49. well-defined (preferably initial, or an isomorphism of initial) state.
  50. Furthermore, one thread is not allowed to observe another thread's
  51. half-completed operations (implicit in this sentence is some tremendous
  52. handwaving about transaction granularity, since a larger transaction
  53. may consist of a number of smaller ones, some of which may succeed
  54. before the larger one fails, or vice-versa).  Such a language might
  55. be really fun (perhaps difficult, but still fun) to program in, because
  56. if the support for this style worked properly, it should lead to more
  57. well-behaved and failure-tolerant programs.
  58.  
  59. But, almost nothing that I mention above as a condition for this "to
  60. happen" is true for C++, and I think it is very unlikely that this will
  61. change.
  62.  
  63. speaking for myself,
  64.  
  65. David Chase
  66. ---
  67. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  68.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  69.   is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
  70.